Before assessing data with ‘CellScore’, the users should first create the abbreviations of the cell types to be tested by ‘CellScore’ and a ‘cell.change’ data frame.
Users of CellScore should define abbreviations for the cell types they want to test. Each abbreviation should be unique and has a 1-to-1 mapping to a cell type.
Function ‘getCellTypeMap’ in this example returns a map between cell types and their abbreviations that are used in this tutorial. Note that this function is not part of the ‘CellScore’ library and it is only for demonstration purpose in this tutorial.
getCellTypeMap <- function() {
## Hardcode abbreviations for each cell type
cellTypes <- c(
"RPE",
"ESC",
"ESC.d",
"ESC.t",
"iPS", ## check the comment
"IPS",
"URI",
"PBMC",
"HUVEC",
"derived cardiomyocyte",
"hepatocyte-like cell",
"hepatocyte",
"fetal liver",
"derived dopaminergic neuron",
"derived neuron",
"spinal cord",
"derived neural progenitor cell",
"derived RPE",
"fetal RPE",
"fetal heart",
"derived neural stem cell",
"naive IPS",
"naive ESC",
"fetal brain",
"derived pancreatic b-like cell",
"derived endoderm",
"derived foregut endoderm",
"derived hepatic endoderm",
"derived early hepatocyte",
"derived late hepatocyte",
"fibroblast",
"induced neuron",
"fibroblast.treated",
"cardiomyocytes",
"hepatocytes",
"dopaminergic neurons",
"neurons",
"neual progenitor cell",
"neural stem cells",
"pancreatic beta cell",
"endoderm",
"foregut endoderm",
"hepatic endoderm",
"neuron",
"lymphocyte")
abbrv <- c(
## Original abbreviations
"RPE",
"ESC",
"ESC.d",
"ESC.t",
"IPS",
"IPS",
"URI",
"PBMC",
"HUVEC",
## Abbreviations named by me
"dCDM",
"HPTL",
"HPT",
"fLIV",
"dDPNEU",
"dNEU",
"SPC",
"dNEUPR",
"dRPE",
"fRPE",
"fHRT",
"dNEUST",
"nIPS",
"nESC",
"fBRN",
"dPCB",
"dEDD",
"dFEDD",
"dHPTEDD",
"dEHPT",
"dLHPT",
"FIB",
"INEU",
"FIB.t",
"CDM",
"HPT",
"DPNEU",
"NEU",
"NEUPR",
"NEUST",
"PCB",
"EDD",
"FEDD",
"HPTEDD",
"NEU",
"LPC")
cellTypeMap <- setNames(abbrv, cellTypes)
# Mapping from full cell type names to their abbrvs
print(cellTypeMap)
cellTypeMap
}
The ‘prepareSampleTransitions’ prepares ‘cell.change’ data frame. This function is not part of ‘CellScore’ library. function ‘prepareSampleTransitions’ is used to generate and save the ‘cell.change’ in a tsv file and is not part of ‘CellScore’ library and only used in this tutorial.
‘cell.change’ data frame contains 3 columns, which are ‘start’, ‘test’ and ‘target’. Each row in the data frame represents the transition in an experiment. The values in the ‘start’ column are the abbreviations of parental cell types (or starting cell types) in the transitions. The values in ‘target’ column are the abbreviations of the target cell types in the transitions. The values in ‘test’ column are in the format ‘{test_cell_type}-{start}’, where ‘{test_cell_type}’ are the abbreviations of the name assigned to the test cells and ‘{start}’ are the abbreviations of parental cell types (or starting cell types). The users should create ‘cell.change’ data frame based on their own experiments
sampleMetadataPath <- system.file("extdata",
"sampleMetadata.csv",
package = "CellScore")
transitionPath <- system.file("extdata",
"exampleTransitionsHsapienData.tsv",
package="CellScore")
prepareSampleTransitions <- function(sampleMetadataPath, transitionPath) {
dat <- read.csv(sampleMetadataPath, header = TRUE)
uniqueCellTypes <- unique(c(as.array(dat$general_cell_type),
as.array(dat$target_cell_type),
as.array(dat$parental_cell_type)))
# Show all the unique cell types in the data
print(uniqueCellTypes)
cellTypeMap <- getCellTypeMap()
uniqueTransitions <- unique(dat[dat$category == 'test',
c('parental_cell_type',
'general_cell_type',
'target_cell_type')])
colnames(uniqueTransitions) <- c("start", "test", "target")
## Exclude samples without parental cell types or without target cell type
uniqueTransitions <- uniqueTransitions[!is.na(uniqueTransitions$start) &
!is.na(uniqueTransitions$target) &
uniqueTransitions$start != '' &
uniqueTransitions$target != '', ]
## Replace full cell type names with abbreviations
uniqueTransitionsAbbrv <- as.data.frame(lapply(uniqueTransitions,
function(element) {
(cellTypeMap[element])
}))
## Format 'test' column
uniqueTransitionsAbbrv$test <- paste(uniqueTransitionsAbbrv$test,
uniqueTransitionsAbbrv$start,
sep = '-')
tempDirPath <- paste(getwd(), 'temp', sep = '/')
dir.create(tempDirPath)
write.table(uniqueTransitionsAbbrv,
file = transitionPath,
quote = FALSE,
sep = '\t')
uniqueTransitionsAbbrv
}
First, load the dependencies and inspect the data
# Load dependencies
library(SummarizedExperiment)
## Loading required package: GenomicRanges
## Loading required package: stats4
## Loading required package: BiocGenerics
## Loading required package: parallel
##
## Attaching package: 'BiocGenerics'
## The following objects are masked from 'package:parallel':
##
## clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
## clusterExport, clusterMap, parApply, parCapply, parLapply,
## parLapplyLB, parRapply, parSapply, parSapplyLB
## The following objects are masked from 'package:stats':
##
## IQR, mad, sd, var, xtabs
## The following objects are masked from 'package:base':
##
## anyDuplicated, append, as.data.frame, basename, cbind, colnames,
## dirname, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
## grepl, intersect, is.unsorted, lapply, Map, mapply, match, mget,
## order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
## rbind, Reduce, rownames, sapply, setdiff, sort, table, tapply,
## union, unique, unsplit, which, which.max, which.min
## Loading required package: S4Vectors
##
## Attaching package: 'S4Vectors'
## The following object is masked from 'package:base':
##
## expand.grid
## Loading required package: IRanges
## Loading required package: GenomeInfoDb
## Loading required package: Biobase
## Welcome to Bioconductor
##
## Vignettes contain introductory material; view with
## 'browseVignettes()'. To cite Bioconductor, see
## 'citation("Biobase")', and for packages 'citation("pkgname")'.
## Loading required package: DelayedArray
## Loading required package: matrixStats
##
## Attaching package: 'matrixStats'
## The following objects are masked from 'package:Biobase':
##
## anyMissing, rowMedians
##
## Attaching package: 'DelayedArray'
## The following objects are masked from 'package:matrixStats':
##
## colMaxs, colMins, colRanges, rowMaxs, rowMins, rowRanges
## The following objects are masked from 'package:base':
##
## aperm, apply, rowsum
library(CellScore)
library(DEE2HsapienData)
# create 'cell.change' data frame and get the map 'CellTypeMap' between cell
# types and their abbreviations
prepareSampleTransitions(sampleMetadataPath, transitionPath)
## [1] "RPE" "ESC"
## [3] "ESC.d" "derived cardiomyocyte"
## [5] "ESC.t" "hepatocyte-like cell"
## [7] "hepatocyte" "fetal liver"
## [9] "derived dopaminergic neuron" "derived neuron"
## [11] "spinal cord" "derived neural progenitor cell"
## [13] "derived RPE" "fetal RPE"
## [15] "iPS" "fetal heart"
## [17] "derived neural stem cell" "IPS"
## [19] "naive IPS" "naive ESC"
## [21] "fetal brain" "derived pancreatic b-like cell"
## [23] "derived endoderm" "derived foregut endoderm"
## [25] "derived hepatic endoderm" "derived early hepatocyte"
## [27] "derived late hepatocyte" "fibroblast"
## [29] "induced neuron" "fibroblast.treated"
## [31] NA "cardiomyocytes"
## [33] "hepatocytes" "dopaminergic neurons"
## [35] "neurons" "neual progenitor cell"
## [37] "neural stem cells" "pancreatic beta cell"
## [39] "endoderm" "foregut endoderm"
## [41] "hepatic endoderm" "neuron"
## [43] "" "lymphocyte"
## [45] "URI" "PBMC"
## [47] "HUVEC"
## RPE ESC
## "RPE" "ESC"
## ESC.d ESC.t
## "ESC.d" "ESC.t"
## iPS IPS
## "IPS" "IPS"
## URI PBMC
## "URI" "PBMC"
## HUVEC derived cardiomyocyte
## "HUVEC" "dCDM"
## hepatocyte-like cell hepatocyte
## "HPTL" "HPT"
## fetal liver derived dopaminergic neuron
## "fLIV" "dDPNEU"
## derived neuron spinal cord
## "dNEU" "SPC"
## derived neural progenitor cell derived RPE
## "dNEUPR" "dRPE"
## fetal RPE fetal heart
## "fRPE" "fHRT"
## derived neural stem cell naive IPS
## "dNEUST" "nIPS"
## naive ESC fetal brain
## "nESC" "fBRN"
## derived pancreatic b-like cell derived endoderm
## "dPCB" "dEDD"
## derived foregut endoderm derived hepatic endoderm
## "dFEDD" "dHPTEDD"
## derived early hepatocyte derived late hepatocyte
## "dEHPT" "dLHPT"
## fibroblast induced neuron
## "FIB" "INEU"
## fibroblast.treated cardiomyocytes
## "FIB.t" "CDM"
## hepatocytes dopaminergic neurons
## "HPT" "DPNEU"
## neurons neual progenitor cell
## "NEU" "NEUPR"
## neural stem cells pancreatic beta cell
## "NEUST" "PCB"
## endoderm foregut endoderm
## "EDD" "FEDD"
## hepatic endoderm neuron
## "HPTEDD" "NEU"
## lymphocyte
## "LPC"
## Warning in dir.create(tempDirPath): '/home/siyuan/CellScore/inst/temp' already
## exists
## start test target
## 1 ESC dCDM-ESC CDM
## 2 ESC HPTL-ESC HPT
## 3 ESC dDPNEU-ESC DPNEU
## 4 IPS dNEU-IPS NEU
## 5 ESC dNEU-ESC NEU
## 6 ESC dNEUPR-ESC NEUPR
## 7 ESC dRPE-ESC RPE
## 8 IPS dRPE-IPS RPE
## 9 IPS dCDM-IPS CDM
## 10 IPS dNEUST-IPS NEUST
## 11 IPS dPCB-IPS PCB
## 12 ESC dEDD-ESC EDD
## 13 ESC dFEDD-ESC FEDD
## 14 ESC dHPTEDD-ESC HPTEDD
## 15 ESC dEHPT-ESC HPT
## 16 ESC dLHPT-ESC HPT
## 17 IPS dEDD-IPS EDD
## 18 IPS dFEDD-IPS FEDD
## 19 IPS dHPTEDD-IPS HPTEDD
## 20 IPS dEHPT-IPS HPT
## 21 IPS dLHPT-IPS HPT
## 22 FIB INEU-FIB NEU
cell.change <- read.delim(
file=transitionPath,
sep="\t",
header=TRUE,
stringsAsFactors=FALSE)
CellTypeMap <- getCellTypeMap()
## RPE ESC
## "RPE" "ESC"
## ESC.d ESC.t
## "ESC.d" "ESC.t"
## iPS IPS
## "IPS" "IPS"
## URI PBMC
## "URI" "PBMC"
## HUVEC derived cardiomyocyte
## "HUVEC" "dCDM"
## hepatocyte-like cell hepatocyte
## "HPTL" "HPT"
## fetal liver derived dopaminergic neuron
## "fLIV" "dDPNEU"
## derived neuron spinal cord
## "dNEU" "SPC"
## derived neural progenitor cell derived RPE
## "dNEUPR" "dRPE"
## fetal RPE fetal heart
## "fRPE" "fHRT"
## derived neural stem cell naive IPS
## "dNEUST" "nIPS"
## naive ESC fetal brain
## "nESC" "fBRN"
## derived pancreatic b-like cell derived endoderm
## "dPCB" "dEDD"
## derived foregut endoderm derived hepatic endoderm
## "dFEDD" "dHPTEDD"
## derived early hepatocyte derived late hepatocyte
## "dEHPT" "dLHPT"
## fibroblast induced neuron
## "FIB" "INEU"
## fibroblast.treated cardiomyocytes
## "FIB.t" "CDM"
## hepatocytes dopaminergic neurons
## "HPT" "DPNEU"
## neurons neual progenitor cell
## "NEU" "NEUPR"
## neural stem cells pancreatic beta cell
## "NEUST" "PCB"
## endoderm foregut endoderm
## "EDD" "FEDD"
## hepatic endoderm neuron
## "HPTEDD" "NEU"
## lymphocyte
## "LPC"
# Path to the data to be assessed
rdata.path <- system.file("extdata", "deseq2NormalizedDee2Data",
package="CellScore")
# Load preprocessed hsapien data in SummarizedExperiment format from DEE2
deseq2NormalizedDee2Data <- readRDS(rdata.path)
normalizedSExpr <- deseq2NormalizedDee2Data$normalizedSExpr
# Set 'SRR_accession' (Todo: fix data package and remove this step)
colData(normalizedSExpr)$SRR_accession <- rownames(colData(normalizedSExpr))
# replace values in 'general_cell_type' with abbrvs
colData(normalizedSExpr)[, 'general_cell_type'] <- unname(as.array(sapply(
normalizedSExpr$general_cell_type,
function(element) CellTypeMap[[element]], USE.NAMES = FALSE)))
# replace values in 'parental_cell_type' with abbrvs
colData(normalizedSExpr)[, 'parental_cell_type'] <- unname(as.array(sapply(
normalizedSExpr$parental_cell_type,
function(element) {
if (is.na(element)) {
return(NA)
}
CellTypeMap[[element]]
}, USE.NAMES = FALSE)))
# set values of 'sub_cell_type1' column
colData(normalizedSExpr)$sub_cell_type1 <- paste(
colData(normalizedSExpr)$general_cell_type,
colData(normalizedSExpr)$parental_cell_type,
sep = '-')
# Set feature_id for of 'rowData' of the input
rowdata <- rowData(normalizedSExpr)
rowdata$feature_id <- rownames(rowdata)
rowData(normalizedSExpr) <- rowdata
# Set assay 'exprs' same as 'counts'
assays(normalizedSExpr)$exprs <- assay(normalizedSExpr, "counts")
coldata <- colData(normalizedSExpr)
# Set 'donor_tissue' as 'parental_cell_type'
colData(normalizedSExpr)$donor_tissue <- coldata$parental_cell_type
# Set the values of 'experiment_id' as values in 'SRX_accession' column of
# the coldata of the input object
sampleMetaData <- read.csv(sampleMetadataPath, header = TRUE)
# Set the values in 'platform_id' as values in 'Platform' column of the
# coldata of the input object.
colData(normalizedSExpr)$platform_id <- colData(normalizedSExpr)$Platform
# Set the values in 'sample_id' as SRR accessions, which are the rownames
# of the coldata of the input object.
colData(normalizedSExpr)$sample_id <- rownames(colData(normalizedSExpr))
# Set the values in 'experiment_id'. In this tutorial, we use transitions as 'experiment_id'
colData(normalizedSExpr)$experiment_id <- unname(unlist(apply(colData(normalizedSExpr), 1,
function(row) {
formatedType <- paste(row[['general_cell_type']],
row[['parental_cell_type']],
sep = '-')
transitionSel <- which(cell.change$test == formatedType)
if (length(transitionSel) == 0) {
return('standard')
}
paste(cell.change[transitionSel, ]['start'],
cell.change[transitionSel, ]['target'],
sep = ' −> ')
})))
pcaPlot(normalizedSExpr)
## Warning in if (plot == "2d") {: the condition has length > 1 and only the first
## element will be used
## Warning: `arrange_()` is deprecated as of dplyr 0.7.0.
## Please use `arrange()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
## We could see there is an outlier in the standard IPS cells and need to exclude
## it from our data
normalizedSExpr[, normalizedSExpr$SRR_accession != 'SRR1198659']
## class: SummarizedExperiment
## dim: 49916 444
## metadata(0):
## assays(3): counts calls exprs
## rownames(49916): ENSG00000223972 ENSG00000227232 ... ENSG00000275987
## ENSG00000277475
## rowData names(6): GeneSymbol mean ... merged feature_id
## colnames(444): SRR1783834 SRR1783835 ... ERR1247125 ERR1247126
## colData names(62): category cell_type ... sample_id experiment_id
pcaPlot(normalizedSExpr)
## Warning in if (plot == "2d") {: the condition has length > 1 and only the first element will be used
## Warning in if (plot == "2d") {: n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
## Warning in if (plot == "2d") {: n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
print("Content of cell.change")
## [1] "Content of cell.change"
print(cell.change)
## start test target
## 1 ESC dCDM-ESC CDM
## 2 ESC HPTL-ESC HPT
## 3 ESC dDPNEU-ESC DPNEU
## 4 IPS dNEU-IPS NEU
## 5 ESC dNEU-ESC NEU
## 6 ESC dNEUPR-ESC NEUPR
## 7 ESC dRPE-ESC RPE
## 8 IPS dRPE-IPS RPE
## 9 IPS dCDM-IPS CDM
## 10 IPS dNEUST-IPS NEUST
## 11 IPS dPCB-IPS PCB
## 12 ESC dEDD-ESC EDD
## 13 ESC dFEDD-ESC FEDD
## 14 ESC dHPTEDD-ESC HPTEDD
## 15 ESC dEHPT-ESC HPT
## 16 ESC dLHPT-ESC HPT
## 17 IPS dEDD-IPS EDD
## 18 IPS dFEDD-IPS FEDD
## 19 IPS dHPTEDD-IPS HPTEDD
## 20 IPS dEHPT-IPS HPT
## 21 IPS dLHPT-IPS HPT
## 22 FIB INEU-FIB NEU
print("'normalizedSExpr' returns")
## [1] "'normalizedSExpr' returns"
print(normalizedSExpr)
## class: SummarizedExperiment
## dim: 49916 445
## metadata(0):
## assays(3): counts calls exprs
## rownames(49916): ENSG00000223972 ENSG00000227232 ... ENSG00000275987
## ENSG00000277475
## rowData names(6): GeneSymbol mean ... merged feature_id
## colnames(445): SRR1783834 SRR1783835 ... ERR1247125 ERR1247126
## colData names(62): category cell_type ... sample_id experiment_id
Calculate ‘OnOff’ scores
group.OnOff <- OnOff(normalizedSExpr, cell.change, out.put="marker.list")
## Warning in NSBS(i, x, exact = exact, strict.upper.bound = !allow.append, :
## subscript is an array, passing it thru as.vector() first
print(summary(group.OnOff))
## Length Class Mode
## scores 10 data.frame list
## markers 8 data.frame list
individ.OnOff <- OnOff(normalizedSExpr, cell.change, out.put="individual")
## Warning in NSBS(i, x, exact = exact, strict.upper.bound = !allow.append, :
## subscript is an array, passing it thru as.vector() first
## To process 4 cell transitions
## Now processing transition ESC -> HPT
##
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 4%
|
|=== | 5%
|
|==== | 5%
|
|==== | 6%
|
|===== | 7%
|
|===== | 8%
|
|====== | 8%
|
|====== | 9%
|
|======= | 9%
|
|======= | 10%
|
|======= | 11%
|
|======== | 11%
|
|======== | 12%
|
|========= | 12%
|
|========= | 13%
|
|========== | 14%
|
|========== | 15%
|
|=========== | 15%
|
|=========== | 16%
|
|============ | 17%
|
|============ | 18%
|
|============= | 18%
|
|============= | 19%
|
|============== | 19%
|
|============== | 20%
|
|============== | 21%
|
|=============== | 21%
|
|=============== | 22%
|
|================ | 22%
|
|================ | 23%
|
|================= | 24%
|
|================= | 25%
|
|================== | 25%
|
|================== | 26%
|
|=================== | 27%
|
|=================== | 28%
|
|==================== | 28%
|
|==================== | 29%
|
|===================== | 29%
|
|===================== | 30%
|
|===================== | 31%
|
|====================== | 31%
|
|====================== | 32%
|
|======================= | 32%
|
|======================= | 33%
|
|======================== | 34%
|
|======================== | 35%
|
|========================= | 35%
|
|========================= | 36%
|
|========================== | 37%
|
|========================== | 38%
|
|=========================== | 38%
|
|=========================== | 39%
|
|============================ | 39%
|
|============================ | 40%
|
|============================ | 41%
|
|============================= | 41%
|
|============================= | 42%
|
|============================== | 42%
|
|============================== | 43%
|
|=============================== | 44%
|
|=============================== | 45%
|
|================================ | 45%
|
|================================ | 46%
|
|================================= | 47%
|
|================================= | 48%
|
|================================== | 48%
|
|================================== | 49%
|
|=================================== | 49%
|
|=================================== | 50%
|
|=================================== | 51%
|
|==================================== | 51%
|
|==================================== | 52%
|
|===================================== | 52%
|
|===================================== | 53%
|
|====================================== | 54%
|
|====================================== | 55%
|
|======================================= | 55%
|
|======================================= | 56%
|
|======================================== | 57%
|
|======================================== | 58%
|
|========================================= | 58%
|
|========================================= | 59%
|
|========================================== | 59%
|
|========================================== | 60%
|
|========================================== | 61%
|
|=========================================== | 61%
|
|=========================================== | 62%
|
|============================================ | 62%
|
|============================================ | 63%
|
|============================================= | 64%
|
|============================================= | 65%
|
|============================================== | 65%
|
|============================================== | 66%
|
|=============================================== | 67%
|
|=============================================== | 68%
|
|================================================ | 68%
|
|================================================ | 69%
|
|================================================= | 69%
|
|================================================= | 70%
|
|================================================= | 71%
|
|================================================== | 71%
|
|================================================== | 72%
|
|=================================================== | 72%
|
|=================================================== | 73%
|
|==================================================== | 74%
|
|==================================================== | 75%
|
|===================================================== | 75%
|
|===================================================== | 76%
|
|====================================================== | 77%
|
|====================================================== | 78%
|
|======================================================= | 78%
|
|======================================================= | 79%
|
|======================================================== | 79%
|
|======================================================== | 80%
|
|======================================================== | 81%
|
|========================================================= | 81%
|
|========================================================= | 82%
|
|========================================================== | 82%
|
|========================================================== | 83%
|
|=========================================================== | 84%
|
|=========================================================== | 85%
|
|============================================================ | 85%
|
|============================================================ | 86%
|
|============================================================= | 87%
|
|============================================================= | 88%
|
|============================================================== | 88%
|
|============================================================== | 89%
|
|=============================================================== | 89%
|
|=============================================================== | 90%
|
|=============================================================== | 91%
|
|================================================================ | 91%
|
|================================================================ | 92%
|
|================================================================= | 92%
|
|================================================================= | 93%
|
|================================================================== | 94%
|
|================================================================== | 95%
|
|=================================================================== | 95%
|
|=================================================================== | 96%
|
|==================================================================== | 97%
|
|==================================================================== | 98%
|
|===================================================================== | 98%
|
|===================================================================== | 99%
|
|======================================================================| 99%
|
|======================================================================| 100%
## Now processing transition ESC -> RPE
##
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 4%
|
|=== | 5%
|
|==== | 5%
|
|==== | 6%
|
|===== | 7%
|
|===== | 8%
|
|====== | 8%
|
|====== | 9%
|
|======= | 9%
|
|======= | 10%
|
|======= | 11%
|
|======== | 11%
|
|======== | 12%
|
|========= | 12%
|
|========= | 13%
|
|========== | 14%
|
|========== | 15%
|
|=========== | 15%
|
|=========== | 16%
|
|============ | 17%
|
|============ | 18%
|
|============= | 18%
|
|============= | 19%
|
|============== | 19%
|
|============== | 20%
|
|============== | 21%
|
|=============== | 21%
|
|=============== | 22%
|
|================ | 22%
|
|================ | 23%
|
|================= | 24%
|
|================= | 25%
|
|================== | 25%
|
|================== | 26%
|
|=================== | 27%
|
|=================== | 28%
|
|==================== | 28%
|
|==================== | 29%
|
|===================== | 29%
|
|===================== | 30%
|
|===================== | 31%
|
|====================== | 31%
|
|====================== | 32%
|
|======================= | 32%
|
|======================= | 33%
|
|======================== | 34%
|
|======================== | 35%
|
|========================= | 35%
|
|========================= | 36%
|
|========================== | 37%
|
|========================== | 38%
|
|=========================== | 38%
|
|=========================== | 39%
|
|============================ | 39%
|
|============================ | 40%
|
|============================ | 41%
|
|============================= | 41%
|
|============================= | 42%
|
|============================== | 42%
|
|============================== | 43%
|
|=============================== | 44%
|
|=============================== | 45%
|
|================================ | 45%
|
|================================ | 46%
|
|================================= | 47%
|
|================================= | 48%
|
|================================== | 48%
|
|================================== | 49%
|
|=================================== | 49%
|
|=================================== | 50%
|
|=================================== | 51%
|
|==================================== | 51%
|
|==================================== | 52%
|
|===================================== | 52%
|
|===================================== | 53%
|
|====================================== | 54%
|
|====================================== | 55%
|
|======================================= | 55%
|
|======================================= | 56%
|
|======================================== | 57%
|
|======================================== | 58%
|
|========================================= | 58%
|
|========================================= | 59%
|
|========================================== | 59%
|
|========================================== | 60%
|
|========================================== | 61%
|
|=========================================== | 61%
|
|=========================================== | 62%
|
|============================================ | 62%
|
|============================================ | 63%
|
|============================================= | 64%
|
|============================================= | 65%
|
|============================================== | 65%
|
|============================================== | 66%
|
|=============================================== | 67%
|
|=============================================== | 68%
|
|================================================ | 68%
|
|================================================ | 69%
|
|================================================= | 69%
|
|================================================= | 70%
|
|================================================= | 71%
|
|================================================== | 71%
|
|================================================== | 72%
|
|=================================================== | 72%
|
|=================================================== | 73%
|
|==================================================== | 74%
|
|==================================================== | 75%
|
|===================================================== | 75%
|
|===================================================== | 76%
|
|====================================================== | 77%
|
|====================================================== | 78%
|
|======================================================= | 78%
|
|======================================================= | 79%
|
|======================================================== | 79%
|
|======================================================== | 80%
|
|======================================================== | 81%
|
|========================================================= | 81%
|
|========================================================= | 82%
|
|========================================================== | 82%
|
|========================================================== | 83%
|
|=========================================================== | 84%
|
|=========================================================== | 85%
|
|============================================================ | 85%
|
|============================================================ | 86%
|
|============================================================= | 87%
|
|============================================================= | 88%
|
|============================================================== | 88%
|
|============================================================== | 89%
|
|=============================================================== | 89%
|
|=============================================================== | 90%
|
|=============================================================== | 91%
|
|================================================================ | 91%
|
|================================================================ | 92%
|
|================================================================= | 92%
|
|================================================================= | 93%
|
|================================================================== | 94%
|
|================================================================== | 95%
|
|=================================================================== | 95%
|
|=================================================================== | 96%
|
|==================================================================== | 97%
|
|==================================================================== | 98%
|
|===================================================================== | 98%
|
|===================================================================== | 99%
|
|======================================================================| 99%
|
|======================================================================| 100%
## Now processing transition IPS -> RPE
##
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 4%
|
|=== | 5%
|
|==== | 5%
|
|==== | 6%
|
|===== | 7%
|
|===== | 8%
|
|====== | 8%
|
|====== | 9%
|
|======= | 9%
|
|======= | 10%
|
|======= | 11%
|
|======== | 11%
|
|======== | 12%
|
|========= | 12%
|
|========= | 13%
|
|========== | 14%
|
|========== | 15%
|
|=========== | 15%
|
|=========== | 16%
|
|============ | 17%
|
|============ | 18%
|
|============= | 18%
|
|============= | 19%
|
|============== | 19%
|
|============== | 20%
|
|============== | 21%
|
|=============== | 21%
|
|=============== | 22%
|
|================ | 22%
|
|================ | 23%
|
|================= | 24%
|
|================= | 25%
|
|================== | 25%
|
|================== | 26%
|
|=================== | 27%
|
|=================== | 28%
|
|==================== | 28%
|
|==================== | 29%
|
|===================== | 29%
|
|===================== | 30%
|
|===================== | 31%
|
|====================== | 31%
|
|====================== | 32%
|
|======================= | 32%
|
|======================= | 33%
|
|======================== | 34%
|
|======================== | 35%
|
|========================= | 35%
|
|========================= | 36%
|
|========================== | 37%
|
|========================== | 38%
|
|=========================== | 38%
|
|=========================== | 39%
|
|============================ | 39%
|
|============================ | 40%
|
|============================ | 41%
|
|============================= | 41%
|
|============================= | 42%
|
|============================== | 42%
|
|============================== | 43%
|
|=============================== | 44%
|
|=============================== | 45%
|
|================================ | 45%
|
|================================ | 46%
|
|================================= | 47%
|
|================================= | 48%
|
|================================== | 48%
|
|================================== | 49%
|
|=================================== | 49%
|
|=================================== | 50%
|
|=================================== | 51%
|
|==================================== | 51%
|
|==================================== | 52%
|
|===================================== | 52%
|
|===================================== | 53%
|
|====================================== | 54%
|
|====================================== | 55%
|
|======================================= | 55%
|
|======================================= | 56%
|
|======================================== | 57%
|
|======================================== | 58%
|
|========================================= | 58%
|
|========================================= | 59%
|
|========================================== | 59%
|
|========================================== | 60%
|
|========================================== | 61%
|
|=========================================== | 61%
|
|=========================================== | 62%
|
|============================================ | 62%
|
|============================================ | 63%
|
|============================================= | 64%
|
|============================================= | 65%
|
|============================================== | 65%
|
|============================================== | 66%
|
|=============================================== | 67%
|
|=============================================== | 68%
|
|================================================ | 68%
|
|================================================ | 69%
|
|================================================= | 69%
|
|================================================= | 70%
|
|================================================= | 71%
|
|================================================== | 71%
|
|================================================== | 72%
|
|=================================================== | 72%
|
|=================================================== | 73%
|
|==================================================== | 74%
|
|==================================================== | 75%
|
|===================================================== | 75%
|
|===================================================== | 76%
|
|====================================================== | 77%
|
|====================================================== | 78%
|
|======================================================= | 78%
|
|======================================================= | 79%
|
|======================================================== | 79%
|
|======================================================== | 80%
|
|======================================================== | 81%
|
|========================================================= | 81%
|
|========================================================= | 82%
|
|========================================================== | 82%
|
|========================================================== | 83%
|
|=========================================================== | 84%
|
|=========================================================== | 85%
|
|============================================================ | 85%
|
|============================================================ | 86%
|
|============================================================= | 87%
|
|============================================================= | 88%
|
|============================================================== | 88%
|
|============================================================== | 89%
|
|=============================================================== | 89%
|
|=============================================================== | 90%
|
|=============================================================== | 91%
|
|================================================================ | 91%
|
|================================================================ | 92%
|
|================================================================= | 92%
|
|================================================================= | 93%
|
|================================================================== | 94%
|
|================================================================== | 95%
|
|=================================================================== | 95%
|
|=================================================================== | 96%
|
|==================================================================== | 97%
|
|==================================================================== | 98%
|
|===================================================================== | 98%
|
|===================================================================== | 99%
|
|======================================================================| 99%
|
|======================================================================| 100%
## Now processing transition IPS -> HPT
##
|
| | 0%
|
| | 1%
|
|= | 1%
|
|= | 2%
|
|== | 2%
|
|== | 3%
|
|=== | 4%
|
|=== | 5%
|
|==== | 5%
|
|==== | 6%
|
|===== | 7%
|
|===== | 8%
|
|====== | 8%
|
|====== | 9%
|
|======= | 9%
|
|======= | 10%
|
|======= | 11%
|
|======== | 11%
|
|======== | 12%
|
|========= | 12%
|
|========= | 13%
|
|========== | 14%
|
|========== | 15%
|
|=========== | 15%
|
|=========== | 16%
|
|============ | 17%
|
|============ | 18%
|
|============= | 18%
|
|============= | 19%
|
|============== | 19%
|
|============== | 20%
|
|============== | 21%
|
|=============== | 21%
|
|=============== | 22%
|
|================ | 22%
|
|================ | 23%
|
|================= | 24%
|
|================= | 25%
|
|================== | 25%
|
|================== | 26%
|
|=================== | 27%
|
|=================== | 28%
|
|==================== | 28%
|
|==================== | 29%
|
|===================== | 29%
|
|===================== | 30%
|
|===================== | 31%
|
|====================== | 31%
|
|====================== | 32%
|
|======================= | 32%
|
|======================= | 33%
|
|======================== | 34%
|
|======================== | 35%
|
|========================= | 35%
|
|========================= | 36%
|
|========================== | 37%
|
|========================== | 38%
|
|=========================== | 38%
|
|=========================== | 39%
|
|============================ | 39%
|
|============================ | 40%
|
|============================ | 41%
|
|============================= | 41%
|
|============================= | 42%
|
|============================== | 42%
|
|============================== | 43%
|
|=============================== | 44%
|
|=============================== | 45%
|
|================================ | 45%
|
|================================ | 46%
|
|================================= | 47%
|
|================================= | 48%
|
|================================== | 48%
|
|================================== | 49%
|
|=================================== | 49%
|
|=================================== | 50%
|
|=================================== | 51%
|
|==================================== | 51%
|
|==================================== | 52%
|
|===================================== | 52%
|
|===================================== | 53%
|
|====================================== | 54%
|
|====================================== | 55%
|
|======================================= | 55%
|
|======================================= | 56%
|
|======================================== | 57%
|
|======================================== | 58%
|
|========================================= | 58%
|
|========================================= | 59%
|
|========================================== | 59%
|
|========================================== | 60%
|
|========================================== | 61%
|
|=========================================== | 61%
|
|=========================================== | 62%
|
|============================================ | 62%
|
|============================================ | 63%
|
|============================================= | 64%
|
|============================================= | 65%
|
|============================================== | 65%
|
|============================================== | 66%
|
|=============================================== | 67%
|
|=============================================== | 68%
|
|================================================ | 68%
|
|================================================ | 69%
|
|================================================= | 69%
|
|================================================= | 70%
|
|================================================= | 71%
|
|================================================== | 71%
|
|================================================== | 72%
|
|=================================================== | 72%
|
|=================================================== | 73%
|
|==================================================== | 74%
|
|==================================================== | 75%
|
|===================================================== | 75%
|
|===================================================== | 76%
|
|====================================================== | 77%
|
|====================================================== | 78%
|
|======================================================= | 78%
|
|======================================================= | 79%
|
|======================================================== | 79%
|
|======================================================== | 80%
|
|======================================================== | 81%
|
|========================================================= | 81%
|
|========================================================= | 82%
|
|========================================================== | 82%
|
|========================================================== | 83%
|
|=========================================================== | 84%
|
|=========================================================== | 85%
|
|============================================================ | 85%
|
|============================================================ | 86%
|
|============================================================= | 87%
|
|============================================================= | 88%
|
|============================================================== | 88%
|
|============================================================== | 89%
|
|=============================================================== | 89%
|
|=============================================================== | 90%
|
|=============================================================== | 91%
|
|================================================================ | 91%
|
|================================================================ | 92%
|
|================================================================= | 92%
|
|================================================================= | 93%
|
|================================================================== | 94%
|
|================================================================== | 95%
|
|=================================================================== | 95%
|
|=================================================================== | 96%
|
|==================================================================== | 97%
|
|==================================================================== | 98%
|
|===================================================================== | 98%
|
|===================================================================== | 99%
|
|======================================================================| 99%
|
|======================================================================| 100%
barplot.out <- BarplotOnOff(normalizedSExpr, group.OnOff$scores)
## Warning in NSBS(i, x, exact = exact, strict.upper.bound = !allow.append, :
## subscript is an array, passing it thru as.vector() first
barplot.out
## $GroupComparisonsForPlot
## start target test markers.start markers.target start.mkrs.in.test
## 15 ESC HPT dEHPT-ESC 566 785 327
## 16 ESC HPT dLHPT-ESC 566 785 309
## 20 IPS HPT dEHPT-IPS 763 548 482
## 21 IPS HPT dLHPT-IPS 763 548 515
## 2 ESC HPT HPTL-ESC 566 785 299
## 7 ESC RPE dRPE-ESC 445 50 61
## 8 IPS RPE dRPE-IPS 717 20 484
## target.mkrs.in.test loss.start.mkrs gain.target.mkrs OnOffScore
## 15 83 0.4222615 0.1057325 0.5279940
## 16 91 0.4540636 0.1159236 0.5699872
## 20 118 0.3682831 0.2153285 0.5836116
## 21 149 0.3250328 0.2718978 0.5969306
## 2 105 0.4717314 0.1337580 0.6054894
## 7 4 0.8629213 0.0800000 0.9429213
## 8 19 0.3249651 0.9500000 1.2749651
##
## $OnOffBarplotData
## position markers markername tags
## 1 Below 0.4222615 loss.start.mkrs dEHPT-ESC
## 2 Below 0.4540636 loss.start.mkrs dLHPT-ESC
## 3 Below 0.3682831 loss.start.mkrs dEHPT-IPS
## 4 Below 0.3250328 loss.start.mkrs dLHPT-IPS
## 5 Below 0.4717314 loss.start.mkrs HPTL-ESC
## 6 Below 0.8629213 loss.start.mkrs dRPE-ESC
## 7 Below 0.3249651 loss.start.mkrs dRPE-IPS
## 8 Above 0.1057325 gain.target.mkrs dEHPT-ESC
## 9 Above 0.1159236 gain.target.mkrs dLHPT-ESC
## 10 Above 0.2153285 gain.target.mkrs dEHPT-IPS
## 11 Above 0.2718978 gain.target.mkrs dLHPT-IPS
## 12 Above 0.1337580 gain.target.mkrs HPTL-ESC
## 13 Above 0.0800000 gain.target.mkrs dRPE-ESC
## 14 Above 0.9500000 gain.target.mkrs dRPE-IPS
tmp.time <- system.time(cs <- CosineSimScore(normalizedSExpr, cell.change,
iqr.cutoff=0.1))
## Warning in NSBS(i, x, exact = exact, strict.upper.bound = !allow.append, :
## subscript is an array, passing it thru as.vector() first
PlotCosineSimHeatmap(cs$cosine.general.groups, "general groups",
width=20, height=20, x=-20, y=3)
## png
## 2
cellscore <- CellScore(normalizedSExpr, cell.change, individ.OnOff$scores,
cs$cosine.samples)
## Warning in NSBS(i, x, exact = exact, strict.upper.bound = !allow.append, :
## subscript is an array, passing it thru as.vector() first
## Warning in NSBS(i, x, exact = exact, strict.upper.bound = !allow.append, :
## subscript is an array, passing it thru as.vector() first
## Warning in NSBS(i, x, exact = exact, strict.upper.bound = !allow.append, :
## subscript is an array, passing it thru as.vector() first
ScatterplotCellScoreComponents(cellscore, cell.change, FALSE)
pdf(file="CellScoreReport_PerTransition.pdf", width=7, height=11)
CellScoreReport(cellscore, cell.change, group.OnOff$markers, normalizedSExpr, group.by = 'transition')
dev.off()
## png
## 2